home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / TUTORIAL.EXE / WK4PROG6.BAS < prev    next >
BASIC Source File  |  1996-02-28  |  1KB  |  42 lines

  1.  
  2.     'WK4PROG6.BAS
  3.     'open a window with a button, a textbox, and a statictext
  4.     'show how trapclose works
  5.     'the window is sized at 300 by 100 at position 200, 150
  6.     WindowWidth = 300
  7.     WindowHeight = 100
  8.     UpperLeftX = 200
  9.     UpperLeftY = 150
  10.     button #myFirst.ok, "OK!", [okClicked], UL, 220, 35
  11.     textbox #myFirst.field, 10, 35, 200, 25
  12.     statictext #myFirst.label, "Type some text here.", 10, 10, 150, 25
  13.     open "myname's first window!" for window as #myFirst
  14.  
  15.     'send the trapclose command
  16.     print #myFirst, "trapclose [quit]"
  17.  
  18. [waitHere]  'now stop and wait
  19.     input aVar$
  20.     goto [quit]
  21.  
  22. [okClicked]  'OK! was clicked.  Get the contents of the entry field
  23.  
  24.     'print a command to the textbox
  25.     print #myFirst.field, "!contents?"
  26.     'now get the contents from the textbox
  27.     input #myFirst.field, aString$
  28.  
  29.     'now pop up a notice saying what was in the textbox
  30.     notice aString$
  31.  
  32. [quit]
  33.     'ask if the user wants to quit
  34.     confirm "Really Quit?"; answer$
  35.     if answer$ <> "yes" then [waitHere] 'abort quitting
  36.  
  37.     'now close the window
  38.     close #myFirst
  39.  
  40.     end
  41.  
  42.